package it.spredt.api;

import android.content.BroadcastReceiver;
import android.content.Intent;
import android.net.Uri;

/**
 * Constants for creating a spredt.
 * 
 * @author mbrehme
 * 
 */
public interface SpredtConstants {
	
	/**
	 * Attributename for: Action to push/put your spredt in the spredt.it plattform .
	 **/
	public static final String	INTENT_ACTION_PUSH			= "it.spredt.push";
	
	/**
	 * Attributename for: Action to send an inter spredt communication message. <b>!!! Important !!!</b> You can use this to send only 1 inter spredt communication message per minute. Every message
	 * within this amount of time is discarded.
	 * 
	 */
	
	public static final String	INTENT_ACTION_ISC			= "it.spredt.isc";
	
	/** Attributename for: Title for the spredt **/
	public static final String	TITLE						= "it.spredt.title";
	/** Attributename for: Contentlabel for the spredt **/
	public static final String	CONTENT_LABEL				= "it.spredt.contentLabel";
	
	/** Attributename for: url for the icon displayed next to the spredt **/
	public static final String	IMAGE_URL					= "it.spredt.imageUrl";
	/** Attributename for: forces the use of the image_url **/
	public static final String	FORCE_IMAGE					= "it.spredt.forceImage";
	
	/** Attributename for: <b>is in the {@link Intent} you specify for an interaction</b> true if the intent is for an {@link BroadcastReceiver} **/
	public static final String	INTENT_EXTRA_IS_BROADCAST	= "it.spredt.isBroadcast";
	
	/** Attributename for: Interaction when user clicks on an spredt **/
	public static final String	ON_CLICK					= "it.spredt.onClick";
	/** Attributename for: Interaction when no application is installed for the spredt. **/
	public static final String	ON_NOT_INSTALLED			= "it.spredt.onNotInstalled";
	/** Attributename for: Interaction when an foreign user(not the spredt-owner) clicks on a spredt (<b> fired on the device of the spredt-owner</b>) **/
	public static final String	ON_FOREIGN_CLICK			= "it.spredt.onForeignClick";
	/**
	 * Attributename for: Interaction when a message from the inter spredt communication framework received.
	 */
	public static final String	ON_ISC_MESSAGE				= "it.spredt.onISCMessage";
	
	/** Url for finding spredt.it in the market **/
	public static final String	MARKET_URL					= "market://details?id=it.spredt.mobile";
	
	/** ID for accessing this spredt **/
	public static final String	ID							= "it.spredt.ID";
	
	/**
	 * URI for requesting spredt.it-userdata via a contentprovider
	 * 
	 */
	public static final Uri		CONTENT_PROVIDER_URI		= Uri.parse("content://it.spredt.provider");
	
	/**
	 * columnName for reading the username from the spredt.it-contentprovider
	 */
	public static final String	CONTENT_PROVIDER_USERNAME	= "username";
	
	/**
	 * Attributename for: <b>is in the {@link Intent} you use for sending an inter spredt communication message</b> contains the unique receiver ID of the message and the spredt for the
	 * communication.</br></br>Has the following format: <b>receiversUniqueUserId</b>@<b>spredtId</b>. Multiple receiver can be separated by a space.
	 */
	public static final String	ISC_INTENT_EXTRA_TO			= "it.spredt.isc.to";
	
	/**
	 * Attributename for: <b>is in the {@link Intent} defined in {@link #ON_ISC_MESSAGE} </b>contains a unique id for answering this inter spredt message.</br></br>Has the following format:
	 * <b>receiversUniqueUserId</b>@<b>spredtId</b>. If the message should be send to the owner of the spredt, receiversUniqueUserId should be replaced by the word <code>owner</code>
	 */
	public static final String	ISC_INTENT_EXTRA_FROM		= "it.spredt.isc.from";
	
	/**
	 * Attributename for: <b>is in the {@link Intent} you use for an inter spredt communication message</b> Contains the message for the interspredt communication. <b>!!! IMPORTANT !!!</b> max
	 * supported length is 512 Bytes
	 */
	public static final String	ISC_INTENT_EXTRA_MSG		= "it.spredt.isc.msg";
	
	/**
	 * Attributename for: action for the broadcast-receiver for listening for status-updates after sending a isc-message
	 */
	public static final String	ISC_ACTION_STATUS			= "it.spredt.isc.status";
	
	/**
	 * Attributename for: intent-extra defined in the broadcast-message received via {@link #ISC_ACTION_STATUS}
	 */
	public static final String	ISC_INTENT_EXTRA_STATUS		= "it.spredt.isc.status";
	
	/**
	 * status-constant for: status received via {@link #ISC_ACTION_STATUS}. The isc-message which should be send does not have a message.
	 */
	public static final int		ISC_STATUS_NO_MESSAGE		= 1;
	
	/**
	 * status-constant for: status received via {@link #ISC_ACTION_STATUS}. The isc-message which should be send is larger than 512 bytes
	 */
	public static final int		ISC_STATUS_MESSAGE_TO_LARGE	= 2;
	
	/**
	 * status-constant for: status received via {@link #ISC_ACTION_STATUS}. the field {@link #ISC_INTENT_EXTRA_TO} is not set.
	 * 
	 * @see #ISC_INTENT_EXTRA_TO
	 */
	public static final int		ISC_STATUS_NO_RECEIVER		= 3;
	
	/**
	 * status-constant for: status received via {@link #ISC_ACTION_STATUS}. the field {@link #ISC_INTENT_EXTRA_TO} has not the correct form.
	 * 
	 * @see #ISC_INTENT_EXTRA_TO
	 */
	public static final int		ISC_STATUS_INVALID_RECEIVER	= 4;
	
	/**
	 * status-constant for: status received via {@link #ISC_ACTION_STATUS}. The user has not updated spredt.it to the newest version. For compatibility reasons, it is important to update to the newest
	 * version.
	 * 
	 * @see #ISC_INTENT_EXTRA_TO
	 */
	public static final int		ISC_STATUS_UPDATE_AVAILABLE	= 5;
	
	/**
	 * status-constant for: status received via {@link #ISC_ACTION_STATUS}. Internal error while sending the isc-message. Try it again later.
	 * 
	 * @see #ISC_INTENT_EXTRA_TO
	 */
	public static final int		ISC_STATUS_INTERNAL_ERROR	= 6;
	
	/**
	 * status-constant for: status received via {@link #ISC_ACTION_STATUS}. Sending of isc-message succeeded.
	 * 
	 * @see #ISC_INTENT_EXTRA_TO
	 */
	public static final int		ISC_STATUS_OK				= 0;
	
}
